import { http } from "@/utils/http.js";

// 库存
export const appStockQuery = (data) => {
  return http.request({
    method: "GET",
    url: "app/stock/query",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const appStoreCenterSelector = (data) => {
  return http.request({
    method: "GET",
    url: "app/storeCenter/selector",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const appShopSelector = (data) => {
  return http.request({
    method: "GET",
    url: "app/shop/selector",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
// 库存
export const appShopSelectorAll = (data) => {
  return http.request({
    method: "GET",
    url: "app/shop/selector/all",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const appEmployeeSelector = (data) => {
  return http.request({
    method: "GET",
    url: "app/employee/selector",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const appScTransferCreate = (data) => {
  return http.request({
    method: "POST",
    url: "app/scTransfer/create",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 调拨单列表
export const appScTransferSource = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/source",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 调拨单列表
export const appScTransferDetail = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/detail",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const returnCreate = (data) => {
  return http.request({
    method: "POST",
    url: "app/scTransfer/return/create",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 调拨单列表
export const appScTransferTarget = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/target",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const scTransferSign = (data) => {
  return http.request({
    method: "POST",
    url: "app/scTransfer/sign",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 库存
export const scTransferRemind = (data) => {
  return http.request({
    method: "POST",
    url: "app/scTransfer/remind",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 调拨单列表
export const appScTransferReturnQuery = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/return/relation",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 调拨单列表
export const appScTransferCountUnsigned = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/countUnsigned",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 退款记录
export const appScTransferReturnQueryList = (data) => {
  return http.request({
    method: "GET",
    url: "app/scTransfer/return/query",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 管理端库存
export const appStockInQuery = (data) => {
  return http.request({
    method: "GET",
    url: "app/stock/inquiry",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 管理端库存
export const appStockQueryOne = (data) => {
  return http.request({
    method: "GET",
    url: "app/stock/queryOne",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 创建自采单
export const StorePurchaseCreate = (data) => {
  return http.request({
    method: "POST",
    url: "app/store/purchase/create",
    data: {
      ...data,
      // offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 管理端库存
export const StorePurchaseQuery = (data) => {
  return http.request({
    method: "GET",
    url: "app/store/purchase/query",
    params: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 管理端库存
export const StorePurchaseDetail = (data) => {
  return http.request({
    method: "GET",
    url: "app/store/purchase/detail",
    params: {
      ...data,
      // offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

// 管理端库存
export const stockLog = (data) => {
  return http.request({
    method: "GET",
    url: "app/stock/log",
    params: {
      ...data,
      // offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
